{include file="public/header" /}
<style type="text/css">
.label-custom{margin-top: 5px;}
.form-group input[type=text],.form-group select{margin-right: 3px;}
.layui-upload-file {display: none!important;opacity: .01;filter: Alpha(opacity=1);}
.input-group-addon{cursor: pointer;}
.w-pay{display: none;}
</style>
        <div class="main-container ace-save-state" id="main-container">
            <script type="text/javascript">
                try{ace.settings.loadState('main-container')}catch(e){}
            </script>

            <div id="sidebar" class="sidebar responsive ace-save-state">
                <script type="text/javascript">
                    try{ace.settings.loadState('sidebar')}catch(e){}
                </script>
                {include file="public/menu" /} 

                <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
                    <i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
                </div>
            </div>

            <div class="main-content">
                <div class="main-content-inner">
                    <div class="breadcrumbs ace-save-state" id="breadcrumbs">
                        <ul class="breadcrumb">
                            <li>
                                <i class="ace-icon fa fa-home home-icon"></i>
                                <a href="{:url('Index/index')}">后台首页</a>
                            </li>
                            <li>订单管理</li>
                            <li>订单修改</li>
                        </ul><!-- /.breadcrumb -->

                    </div>

                    <div class="page-content">

                        <div class="row">
                            <div class="col-xs-12">
                                <form id="form">
                                <input type="hidden" name="id" value="{$order['id']|default=''}">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"> 收件人： </label>

                                        <div class="col-sm-9">
                                            <input type="text" autocomplete="off" name="name" id="name" placeholder="收件人" class="col-xs-10 col-sm-6" value="{$order['name']|default=''}">
                                        </div>
                                    </div>
                                </div>

                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"> 省市县： </label>

                                        <div class="col-sm-9">
                                            <input type="text" autocomplete="off" name="city" id="ssx" placeholder="请输入省市县" class="col-xs-10 col-sm-6" value="{$order['city']|default=''}">
                                        </div>
                                    </div>
                                </div>

                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"> 地址： </label>

                                        <div class="col-sm-9">
                                            <input type="text" autocomplete="off" name="address" id="address" placeholder="请输入地址" class="col-xs-10 col-sm-6" value="{$order['address']|default=''}">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"> 手机号： </label>

                                        <div class="col-sm-9">
                                            <input type="text" autocomplete="off" name="tel" id="tel" placeholder="请输入手机号" class="col-xs-10 col-sm-6" value="{$order['mobile']|default=''}">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"> 套餐： </label>
                                        <div class="col-sm-9">
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check = in_array("第五套人民币8同号钞1套496元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" class="ace" value="第五套人民币8同号钞1套496元（含10元邮费）" {eq name="check" value="true"}checked{/eq}>
                                                    <span class="lbl"> 第五套人民币8同号钞1套496元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check2 = in_array("第五套人民币8同号钞2套982元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check2" value="true"}checked{/eq} class="ace" value="第五套人民币8同号钞2套982元（含10元邮费）">
                                                    <span class="lbl"> 第五套人民币8同号钞2套982元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check3 = in_array("第五套人民币8同号5套2440元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check3" value="true"}checked{/eq} class="ace" value="第五套人民币8同号5套2440元（含10元邮费）">
                                                    <span class="lbl"> 第五套人民币8同号5套2440元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check4 = in_array("第四套人民币4同号1套898元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check4" value="true"}checked{/eq} class="ace" value="第四套人民币4同号1套898元（含10元邮费）">
                                                    <span class="lbl"> 第四套人民币4同号1套898元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check5 = in_array("第四套人民币4同号2套1786元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check5" value="true"}checked{/eq} class="ace" value="第四套人民币4同号2套1786元（含10元邮费）">
                                                    <span class="lbl"> 第四套人民币4同号2套1786元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check6 = in_array("第五套1套+第四套1套1384元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check6" value="true"}checked{/eq} class="ace" value="第五套1套+第四套1套1384元（含10元邮费）">
                                                    <span class="lbl"> 第五套1套+第四套1套1384元（含10元邮费）</span>
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                    {php}$check7 = in_array("第五套2套+第四套2套2758元（含10元邮费）",$order['items']);{/php}
                                                    <input type="checkbox" name="checkbox1[]" {eq name="check7" value="true"}checked{/eq} class="ace" value="第五套2套+第四套2套2758元（含10元邮费）">
                                                    <span class="lbl"> 第五套2套+第四套2套2758元（含10元邮费）</span>
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                </form>
                                <div class="hr hr32 hr-dotted"></div>
                                <button class="btn btn-success btn-block" id="submit">点击保存</button>

                                <!-- PAGE CONTENT ENDS -->
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div>
            </div><!-- /.main-content -->

            <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
                <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
            </a>
        </div><!-- /.main-container -->
        {include file="public/footer" /}
        <script type="text/javascript">


        // form 提交
        $('#submit').on('click', function(){
            var username = $('#name').val();
            var address = $('#address').val();
            var mobile = $('#tel').val();
            var city = $('#ssx').val();
            if(!username) {
                alert('收件人不能为空');
                return;
            }
            if(!city) {
                alert('省市县不能为空');
                return;
            }
            if(!address) {
                alert('地址不能为空');
                return;
            }
            if(!mobile.match(/^1[0-9][0-9]{9}$/)) {
                alert('手机号码格式不正确');
                return;
            }
            if($("input[name='checkbox1[]']:checked").length < 1){
                alert('套餐最少选一项');
                return;
            }
            $.ajax({
                url:"{:url('Order/order_do_edit')}",
                type:"POST",
                data:$("#form").serialize(),
                success: function(data) {
                    // console.log(data)
                    if(data.code) {
                        // alert('提交成功');
                        window.location.reload();
                    }else{
                        alert(data.msg);
                    }
                            
                }
            }); 

        });

        </script>
    </body>
</html>
